package com.study.mirrorforest.main.model.summaries.controller;


import com.study.mirrorforest.main.common.response.R;
import com.study.mirrorforest.main.model.summaries.dto.SummaryDTO;
import com.study.mirrorforest.main.model.summaries.service.Impl.SummaryServiceImpl;
import com.study.mirrorforest.main.model.summaries.service.SummaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/summaries")
public class SummaryController {

    @Autowired
    SummaryServiceImpl summaryService;
    @GetMapping("/daily")
    public R getDailySummary(@RequestParam String date,
                             @RequestParam Long userId
    ) {
        SummaryDTO summaryDto = new SummaryDTO(userId,date);
        System.out.println(summaryDto);
        return summaryService.GetDailySummary(summaryDto);
    }




}
